<script>
    $(document).ready(function () {
        $('.empdata').click(function () {
            var id = $(this).attr('id');
            var key = {
                e_empleado_id: id
            };
            $.ajax({
                url: "<?= base_url('repEmpleados/saveDataHistorial') ?>",
                type: 'POST',
                data: key,
                success: function (msg) {
                    console.log('mensaje: '+id);
                    window.location.href = "<?= base_url('repEmpleados/historial') ?>";
                }
            });
        });        
    });
</script>
<!-- Content -->
<div id="content">
    <!-- Content wrapper -->
    <div class="wrapper">
        <h5 class="widget-name"><i class="icon-columns"></i>Reporte Usuarios</h5>
        
        <!-- Default datatable -->
        <div class="widget">
            <div class="navbar"><div class="navbar-inner"><h6>Usuarios</h6></div></div>
            <div class="table-overflow">
                <table class="table table-striped table-bordered" id="data-table">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Nombre </th>
                            <th>Empresa</th>
                            <th>División</th>
                            <th>Promedio </th>
                            <th>Detalles</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($datosEmp as $key => $emp){?>
                        <tr>
                            <td><?= $key ?></td>
                            <td><?=$emp['e_nombre'] ?></td>
                            <td><?=$emp['em_nombre'] ?></td>
                            <td><?=$emp['d_nombre'] ?></td>
                            <td><?=$emp['promedio'] ?></td>
                            <td><a href=""><i class="fam-zoom empdata" id="<?= $key ?>"></a></i></td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- /default datatable -->
    </div>
    <!-- /Content wrapper -->
</div>
<!-- /Content -->